package com.dm.shop.service.impl;

import com.dm.shop.common.enums.ResultEnum;
import com.dm.shop.entity.Comment;
import com.dm.shop.entity.User;
import com.dm.shop.mapper.CommentMapper;
import com.dm.shop.service.CommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dm.shop.utils.ResultUtil;
import com.dm.shop.vo.Result;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MyBatisPlusGenerater-Saiya Wang
 * @since 2021-07-20
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {

    @Override
    public Result addComment(Comment comment) {
        boolean IsSave = this.save(comment);
        if(IsSave!=true){
            return ResultUtil.error(ResultEnum.FAIL);
        }
        else {
            return ResultUtil.success(ResultEnum.SUCCESS);
        }
    }
}
